CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/software/[index].tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import {
7
LANGUAGE_NAMES,
8
SOFTWARE_ENV_DEFAULT,
9
} from "@cocalc/util/consts/software-envs";
10
11
const INDEX_PAGES = LANGUAGE_NAMES.map((l) => l.toLowerCase()).concat(
12
"executables"
13
) as readonly string[];
14
15
export default function SoftwareIndex() {
16
return <></>;
17
}
18
19
export async function getServerSideProps(context) {
20
const { index } = context.params;
21
if (!INDEX_PAGES.includes(index)) {
22
return { notFound: true };
23
} else {
24
// permanent redirect, since this page is deprecated and the default software env version should be used
25
return context.res.redirect(
26
308,
27
`/software/${index}/${SOFTWARE_ENV_DEFAULT}`
28
);
29
}
30
}
31
32